home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 186 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: news.mindlink.net!news
  2. From: genew@mindlink.bc.ca (Gene Wirchenko)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Count lines in file?
  5. Date: Wed, 03 Jan 1996 05:32:37 GMT
  6. Organization: MIND LINK! - British Columbia, Canada
  7. Message-ID: <4cd4lm$j62@fountain.mindlink.net>
  8. References: <4bfnqu$btj@news1.netzone.com> <4bi4nr$3qe@castle.nando.net> <4bk30e$l08@news1.netzone.com> <Pine.A32.3.91.951224222853.23094E@red.weeg.uiowa.edu> <4bm9tk$h5a@crl14.crl.com> <820334651snz@genesis.demon.co.uk> <4c4v8b$kb6@crl5.crl.com> <820601750snz@genesis.demon.co.uk>
  9. NNTP-Posting-Host: line217.nwm.mindlink.net
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. Lawrence Kirby <fred@genesis.demon.co.uk> wrote:
  13.  
  14. [Attack of the giant scissors]
  15.  
  16. >>Oh, before someone else points it out:  One problem with getc might be if 
  17. >>the last line of the program doesn't have a terminating newline 
  18. >>character, i.e. it terminates with the eof.  This could cause the count 
  19. >>to be off by one in such cases.
  20.  
  21. >It depends on your definition of a 'line'. It is reasonable to say is that
  22. >of the final sequence of characters is not terminated by '\n' it is not
  23. >a valid line.
  24.  
  25. [snip]
  26.  
  27.      You'd run into trouble on a UNIX system where the final line ends
  28. with the end of file.  (In my limited experience: UNIX experts, if I'm
  29. wrong, just smile to yourself and read on.)
  30.  
  31.      Come on, Mr. Kirby!
  32.  
  33.      It depends on your definition of a "line".  It is reasonable to
  34. say that if <implementation defined condition>, it is not a line.
  35.  
  36. Sincerely,
  37.  
  38. Gene Wirchenko
  39.  
  40. C Pronunciation Guide:
  41.      y=x++;     "wye equals ex plus plus semicolon"
  42.      x=x++;     "ex equals ex doublecross semicolon"
  43.  
  44.